home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
fish
/
676-700
/
681
/
term
/
source.lha
/
TerminalPanel.c
< prev
next >
Wrap
C/C++ Source or Header
|
1992-05-09
|
20KB
|
694 lines
/*
** $Id: TerminalPanel.c,v 1.4 92/04/21 17:00:14 olsen Sta Locker: olsen $
** $Revision: 1.4 $
** $Date: 92/04/21 17:00:14 $
**
** Editing panel for terminal configuration
**
** Copyright © 1990-1992 by Olaf `Olsen' Barthel & MXM
** All Rights Reserved
*/
#include "termGlobal.h"
enum { GAD_FILTER,GAD_DESTRBS,GAD_SWAP,GAD_STRIP,GAD_DISABLE,
GAD_FASTER,GAD_TITLEBAR,GAD_STATUSLINE,GAD_ANSWERBACK,GAD_CR,GAD_LF,GAD_RECEIVECR,GAD_RECEIVELF,GAD_BELL,
GAD_SIZE,GAD_COLOUR,GAD_EMULATIONCTRL,GAD_EMUNAME,GAD_NEWEMU,GAD_FONT,GAD_KEYMAP,
GAD_USE,GAD_CANCEL };
#define WIDTH 640
#define HEIGHT 190
STATIC STRPTR DisplaySizeType[4] =
{
NULL,
NULL,
NULL,
NULL
};
STATIC STRPTR BellType[6] =
{
NULL,
NULL,
NULL,
NULL,
NULL,
NULL
};
STATIC STRPTR CRType[4] =
{
NULL,
NULL,
NULL,
NULL
};
STATIC STRPTR LFType[4] =
{
NULL,
NULL,
NULL,
NULL
};
STATIC STRPTR Emulation[5] =
{
NULL,
NULL,
NULL,
NULL,
NULL
};
STATIC STRPTR ColourMode[5] =
{
NULL,
NULL,
NULL,
NULL,
NULL
};
STATIC STRPTR Fonts[3] =
{
NULL,
NULL,
NULL
};
STATIC STRPTR StatusLine[4] =
{
NULL,
NULL,
NULL,
NULL
};
/* Which item to select for current combination of bell modes. */
STATIC BYTE BellMode;
STATIC struct Gadget *
CreateAllGadgets(struct Configuration *Config,struct Gadget *GadgetArray[],struct Gadget **GadgetList,APTR VisualInfo,UWORD TopEdge)
{
struct Gadget *Gadget;
struct NewGadget NewGadget;
UWORD Counter = 0;
LocalizeString(DisplaySizeType,MSG_TERMINALPANEL_SCREEN_SIZE_TXT,MSG_TERMINALPANEL_80_X_25_TXT);
LocalizeString(BellType,MSG_TERMINALPANEL_IGNORE_BELL_TXT,MSG_TERMINALPANEL_SYSTEM_DEFAULT_TXT);
LocalizeString(CRType,MSG_TERMINALPANEL_IGNORE_CR_TXT,MSG_TERMINALPANEL_AS_CR_LF_TXT);
LocalizeString(LFType,MSG_TERMINALPANEL_IGNORE_LF_TXT,MSG_TERMINALPANEL_AS_LF_CR_TXT);
LocalizeString(Emulation,MSG_TERMINALPANEL_ANSI_VT102_TXT,MSG_TERMINALPANEL_EXTERNAL_TXT);
LocalizeString(ColourMode,MSG_TERMINALPANEL_AMIGA_TXT,MSG_TERMINALPANEL_MONO_TXT);
LocalizeString(Fonts,MSG_TERMINALPANEL_TOPAZ_TXT,MSG_TERMINALPANEL_IBM_PC_STYLE_TXT);
LocalizeString(StatusLine,MSG_TERMINALPANEL_STATUS_DISABLED_TXT,MSG_TERMINALPANEL_STATUS_COMPACT_TXT);
memset(&NewGadget,0,sizeof(struct NewGadget));
if(Gadget = CreateContext(GadgetList))
{
NewGadget . ng_Width = 26;
NewGadget . ng_Height = 12;
NewGadget . ng_GadgetText = LocaleString(MSG_TERMINALPANEL_CAPTURE_FILTER_GAD);
NewGadget . ng_TextAttr = &DefaultFont;
NewGadget . ng_VisualInfo = VisualInfo;
NewGadget . ng_GadgetID = Counter;
NewGadget . ng_LeftEdge = (GadToolsLongestString(MSG_TERMINALPANEL_CAPTURE_FILTER_GAD,MSG_TERMINALPANEL_ANSWERBACK_MESSAGE_GAD) + 1) * 8 + 10;
NewGadget . ng_TopEdge = 1 + TopEdge;
GadgetArray[Counter++] = Gadget = CreateGadget(CHECKBOX_KIND,Gadget,&NewGadget,
GT_Underscore, '_',
GTCB_Checked, Config -> CaptureFilter,
TAG_DONE);
NewGadget . ng_GadgetText = LocaleString(MSG_TERMINALPANEL_DESTRUCTIVE_BS_GAD);
NewGadget . ng_GadgetID = Counter;
NewGadget . ng_TopEdge = NewGadget . ng_TopEdge + NewGadget . ng_Height + 1;
GadgetArray[Counter++] = Gadget = CreateGadget(CHECKBOX_KIND,Gadget,&NewGadget,
GT_Underscore, '_',
GTCB_Checked, Config -> DestructiveBackspace,
TAG_DONE);
NewGadget . ng_GadgetText = LocaleString(MSG_TERMINALPANEL_SWAP_DEL_BS_GAD);
NewGadget . ng_GadgetID = Counter;
NewGadget . ng_TopEdge = NewGadget . ng_TopEdge + NewGadget . ng_Height + 1;
GadgetArray[Counter++] = Gadget = CreateGadget(CHECKBOX_KIND,Gadget,&NewGadget,
GT_Underscore, '_',
GTCB_Checked, Config -> SwapBSDelete,
TAG_DONE);
NewGadget . ng_GadgetText = LocaleString(MSG_TERMINALPANEL_STRIP_BIT_8_GAD);
NewGadget . ng_GadgetID = Counter;
NewGadget . ng_TopEdge = NewGadget . ng_TopEdge + NewGadget . ng_Height + 1;
GadgetArray[Counter++] = Gadget = CreateGadget(CHECKBOX_KIND,Gadget,&NewGadget,
GT_Underscore, '_',
GTCB_Checked, Config -> StripBit8,
TAG_DONE);
NewGadget . ng_GadgetText = LocaleString(MSG_TERMINALPANEL_STOP_BLINKING_GAD);
NewGadget . ng_GadgetID = Counter;
NewGadget . ng_TopEdge = NewGadget . ng_TopEdge + NewGadget . ng_Height + 1;
GadgetArray[Counter++] = Gadget = CreateGadget(CHECKBOX_KIND,Gadget,&NewGadget,
GT_Underscore, '_',
GTCB_Checked, Config -> DisableBlinking & ~TERMINAL_FASTER,
TAG_DONE);
NewGadget . ng_GadgetText = LocaleString(MSG_TERMINALPANEL_FASTER_LAYOUT_GAD);
NewGadget . ng_GadgetID = Counter;
NewGadget . ng_TopEdge = NewGadget . ng_TopEdge + NewGadget . ng_Height + 1;
GadgetArray[Counter++] = Gadget = CreateGadget(CHECKBOX_KIND,Gadget,&NewGadget,
GT_Underscore, '_',
GTCB_Checked, Config -> DisableBlinking & TERMINAL_FASTER,
TAG_DONE);
NewGadget . ng_GadgetText = LocaleString(MSG_TERMINALPANEL_SCREEN_TITLE_GAD);
NewGadget . ng_GadgetID = Counter;
NewGadget . ng_TopEdge = NewGadget . ng_TopEdge + NewGadget . ng_Height + 1;
GadgetArray[Counter++] = Gadget = CreateGadget(CHECKBOX_KIND,Gadget,&NewGadget,
GT_Underscore, '_',
GTCB_Checked, Config -> TitleBar,
TAG_DONE);
NewGadget . ng_GadgetText = LocaleString(MSG_TERMINALPANEL_STATUS_LINE_GAD);
NewGadget . ng_GadgetID = Counter;
NewGadget . ng_TopEdge = NewGadget . ng_TopEdge + NewGadget . ng_Height + 1;
NewGadget . ng_Width = 164;
GadgetArray[Counter++] = Gadget = CreateGadget(CYCLE_KIND,Gadget,&NewGadget,
GT_Underscore, '_',
GTCY_Labels, StatusLine,
GTCY_Active, Config -> StatusLine,
TAG_DONE);
NewGadget . ng_GadgetText = LocaleString(MSG_TERMINALPANEL_ANSWERBACK_MESSAGE_GAD);
NewGadget . ng_GadgetID = Counter;
NewGadget . ng_TopEdge = NewGadget . ng_TopEdge + NewGadget . ng_Height + 1;
NewGadget . ng_Height = 14;
GadgetArray[Counter++] = Gadget = CreateGadget(STRING_KIND,Gadget,&NewGadget,
GT_Underscore, '_',
GTST_MaxChars, 40,
GTST_String, Config -> AnswerBack,
GTST_EditHook, &CommandHook,
GA_Immediate, TRUE,
TAG_DONE);
NewGadget . ng_GadgetText = LocaleString(MSG_TERMINALPANEL_SEND_CR_GAD);
NewGadget . ng_GadgetID = Counter;
NewGadget . ng_TopEdge = 1 + TopEdge;
NewGadget . ng_Width = 164;
NewGadget . ng_Height = 12;
NewGadget . ng_LeftEdge = WIDTH - 10 - NewGadget . ng_Width;
GadgetArray[Counter++] = Gadget = CreateGadget(CYCLE_KIND,Gadget,&NewGadget,
GT_Underscore, '_',
GTCY_Labels, CRType,
GTCY_Active, Config -> SendCR,
TAG_DONE);
NewGadget . ng_GadgetText = LocaleString(MSG_TERMINALPANEL_SEND_LF_GAD);
NewGadget . ng_GadgetID = Counter;
NewGadget . ng_TopEdge = NewGadget . ng_TopEdge + NewGadget . ng_Height + 1;
GadgetArray[Counter++] = Gadget = CreateGadget(CYCLE_KIND,Gadget,&NewGadget,
GT_Underscore, '_',
GTCY_Labels, LFType,
GTCY_Active, Config -> SendLF,
TAG_DONE);
NewGadget . ng_GadgetText = LocaleString(MSG_TERMINALPANEL_RECEIVE_CR_GAD);
NewGadget . ng_GadgetID = Counter;
NewGadget . ng_TopEdge = NewGadget . ng_TopEdge + NewGadget . ng_Height + 1;
NewGadget . ng_Width = 164;
GadgetArray[Counter++] = Gadget = CreateGadget(CYCLE_KIND,Gadget,&NewGadget,
GT_Underscore, '_',
GTCY_Labels, CRType,
GTCY_Active, Config -> ReceiveCR,
TAG_DONE);
NewGadget . ng_GadgetText = LocaleString(MSG_TERMINALPANEL_RECEIVE_LF_GAD);
NewGadget . ng_GadgetID = Counter;
NewGadget . ng_TopEdge = NewGadget . ng_TopEdge + NewGadget . ng_Height + 1;
GadgetArray[Counter++] = Gadget = CreateGadget(CYCLE_KIND,Gadget,&NewGadget,
GT_Underscore, '_',
GTCY_Labels, LFType,
GTCY_Active, Config -> ReceiveLF,
TAG_DONE);
if(Config -> SystemBeep)
BellMode = 4;
else
{
if(Config -> AudibleBell)
{
if(Config -> VisibleBell)
BellMode = 3;
else
BellMode = 2;
}
else
{
if(Config -> VisibleBell)
BellMode = 1;
else
BellMode = 0;
}
}
NewGadget . ng_GadgetText = LocaleString(MSG_TERMINALPANEL_BELL_GAD);
NewGadget . ng_GadgetID = Counter;
NewGadget . ng_TopEdge = NewGadget . ng_TopEdge + NewGadget . ng_Height + 1;
GadgetArray[Counter++] = Gadget = CreateGadget(CYCLE_KIND,Gadget,&NewGadget,
GT_Underscore, '_',
GTCY_Labels, BellType,
GTCY_Active, BellMode,
TAG_DONE);
NewGadget . ng_GadgetText = LocaleString(MSG_TERMINALPANEL_DISPLAY_SIZE_GAD);
NewGadget . ng_GadgetID = Counter;
NewGadget . ng_TopEdge = NewGadget . ng_TopEdge + NewGadget . ng_Height + 1;
GadgetArray[Counter++] = Gadget = CreateGadget(CYCLE_KIND,Gadget,&NewGadget,
GT_Underscore, '_',
GTCY_Labels, DisplaySizeType,
GTCY_Active, Config -> EightyColumns,
GA_Disabled, (Window -> Height >> 3) < 25,
TAG_DONE);
NewGadget . ng_GadgetText = LocaleString(MSG_TERMINALPANEL_COLOUR_GAD);
NewGadget . ng_GadgetID = Counter;
NewGadget . ng_TopEdge = NewGadget . ng_TopEdge + NewGadget . ng_Height + 1;
GadgetArray[Counter++] = Gadget = CreateGadget(CYCLE_KIND,Gadget,&NewGadget,
GT_Underscore, '_',
GTCY_Labels, ColourMode,
GTCY_Active, Config -> ColourMode,
TAG_DONE);
NewGadget . ng_GadgetText = LocaleString(MSG_TERMINALPANEL_EMULATION_GAD);
NewGadget . ng_GadgetID = Counter;
NewGadget . ng_TopEdge = NewGadget . ng_TopEdge + NewGadget . ng_Height + 1;
GadgetArray[Counter++] = Gadget = CreateGadget(CYCLE_KIND,Gadget,&NewGadget,
GT_Underscore, '_',
GTCY_Labels, Emulation,
GTCY_Active, Config -> Emulation,
TAG_DONE);
NewGadget . ng_GadgetText = LocaleString(MSG_TERMINALPANEL_EMU__NAME_GAD);
NewGadget . ng_GadgetID = Counter;
NewGadget . ng_TopEdge = NewGadget . ng_TopEdge + NewGadget . ng_Height + 1;
NewGadget . ng_Height = 14;
GadgetArray[Counter++] = Gadget = CreateGadget(STRING_KIND,Gadget,&NewGadget,
GT_Underscore, '_',
GTST_MaxChars, 255,
GTST_String, Config -> EmulationName,
GA_Disabled, Config -> Emulation != EMULATION_EXTERNAL,
GTST_EditHook, &CommandHook,
GA_Immediate, TRUE,
TAG_DONE);
NewGadget . ng_GadgetText = LocaleString(MSG_TERMINALPANEL_SELECT_NEW_EMULATION_GAD);
NewGadget . ng_GadgetID = Counter;
NewGadget . ng_TopEdge = NewGadget . ng_TopEdge + NewGadget . ng_Height + 1;
NewGadget . ng_Height = 12;
GadgetArray[Counter++] = Gadget = CreateGadget(BUTTON_KIND,Gadget,&NewGadget,
GT_Underscore, '_',
GA_Disabled, Config -> Emulation != EMULATION_EXTERNAL,
TAG_DONE);
NewGadget . ng_GadgetText = LocaleString(MSG_TERMINALPANEL_FONT_GAD);
NewGadget . ng_GadgetID = Counter;
NewGadget . ng_TopEdge = NewGadget . ng_TopEdge + NewGadget . ng_Height + 1;
GadgetArray[Counter++] = Gadget = CreateGadget(CYCLE_KIND,Gadget,&NewGadget,
GT_Underscore, '_',
GTCY_Labels, Fonts,
GTCY_Active, Config -> Font,
GA_Disabled, (!IBM || Config -> Emulation == EMULATION_EXTERNAL),
TAG_DONE);
NewGadget . ng_GadgetText = LocaleString(MSG_TERMINALPANEL_KEYMAP_NAME_GAD);
NewGadget . ng_GadgetID = Counter;
NewGadget . ng_TopEdge = NewGadget . ng_TopEdge + NewGadget . ng_Height + 1;
NewGadget . ng_Height = 14;
GadgetArray[Counter++] = Gadget = CreateGadget(STRING_KIND,Gadget,&NewGadget,
GT_Underscore, '_',
GTST_MaxChars, 39,
GTST_String, Config -> KeyMapName,
GTST_EditHook, &CommandHook,
GA_Immediate, TRUE,
TAG_DONE);
NewGadget . ng_Width = 88; /* NEW 52 */
NewGadget . ng_Height = 12;
NewGadget . ng_GadgetText = LocaleString(MSG_GLOBAL_USE_GAD);
NewGadget . ng_GadgetID = Counter;
NewGadget . ng_Flags = 0;
NewGadget . ng_LeftEdge = 10;
NewGadget . ng_TopEdge = HEIGHT - 3 - NewGadget . ng_Height;
GadgetArray[Counter++] = Gadget = CreateGadget(BUTTON_KIND,Gadget,&NewGadget,
GT_Underscore, '_',
TAG_DONE);
NewGadget . ng_GadgetText = LocaleString(MSG_GLOBAL_CANCEL_GAD);
NewGadget . ng_GadgetID = Counter;
NewGadget . ng_LeftEdge = WIDTH - 10 - NewGadget . ng_Width;
GadgetArray[Counter++] = Gadget = CreateGadget(BUTTON_KIND,Gadget,&NewGadget,
GT_Underscore, '_',
TAG_DONE);
}
return(Gadget);
}
/* SelectEmulator(UBYTE *Name,struct Window *ParentWindow):
*
* Select a new emulator driver using the
* asl.library file requester.
*/
STATIC BYTE
SelectEmulator(UBYTE *Name,struct Window *ParentWindow)
{
struct FileRequester *AslFileRequest;
UBYTE *File,*Temp;
BYTE NewDriver = FALSE;
File = Name;
strcpy(SharedBuffer,File);
Temp = PathPart(SharedBuffer);
Temp[0] = 0;
if(!SharedBuffer[0])
strcpy(SharedBuffer,"Libs:");
File = FilePart(File);
if(AslFileRequest = (struct FileRequester *)AllocAslRequestTags(ASL_FileRequest,
ASL_Window, ParentWindow,
ASL_File, File,
ASL_Dir, SharedBuffer,
ASL_Hail, LocaleString(MSG_TERMINALPANEL_SELECT_EMULATOR_TXT),
ASL_FuncFlags, FILF_NEWIDCMP,
ASL_Pattern, "XEm#?.library",
ASL_OKText, LocaleString(MSG_GLOBAL_SELECT_TXT),
TAG_END))
{
if(AslRequestTags(AslFileRequest,TAG_DONE))
{
if(AslFileRequest -> rf_File[0])
{
if(Stricmp(AslFileRequest -> rf_Dir,"Libs:"))
strcpy(SharedBuffer,AslFileRequest -> rf_Dir);
else
SharedBuffer[0] = 0;
if(!AddPart(SharedBuffer,AslFileRequest -> rf_File,256))
strcpy(SharedBuffer,AslFileRequest -> rf_File);
if(Stricmp(SharedBuffer,Name))
{
strcpy(Name,SharedBuffer);
NewDriver = TRUE;
}
}
}
FreeAslRequest(AslFileRequest);
}
return(NewDriver);
}
VOID
TerminalPanel(struct Configuration *Config)
{
struct Window *PanelWindow;
struct Gadget *GadgetList = NULL;
struct Gadget *GadgetArray[GAD_CANCEL + 1];
UBYTE DummyBuffer[256];
CopyMem(Config,&PrivateConfig,sizeof(struct Configuration));
if(CreateAllGadgets(Config,&GadgetArray[0],&GadgetList,VisualInfo,Screen -> WBorTop + Screen -> Font -> ta_YSize + 1))
{
if(PanelWindow = OpenWindowTags(NULL,
WA_Left, (Screen -> Width - WIDTH) >> 1,
WA_Top, (Screen -> Height - HEIGHT) >> 1,
WA_Width, WIDTH,
WA_Height, HEIGHT,
WA_Activate, TRUE,
WA_DragBar, TRUE,
WA_DepthGadget, TRUE,
WA_RMBTrap, TRUE,
WA_DepthGadget, TRUE,
WA_CloseGadget, TRUE,
WA_CustomScreen,Screen,
WA_IDCMP, IDCMP_CLOSEWINDOW | IDCMP_VANILLAKEY | IDCMP_GADGETDOWN | BUTTONIDCMP | CHECKBOXIDCMP | CYCLEIDCMP | STRINGIDCMP,
WA_Title, LocaleString(MSG_TERMINALPANEL_TERMINAL_PREFERENCES_TXT),
TAG_DONE))
{
struct IntuiMessage *Massage;
ULONG Class,Code;
struct Gadget *Gadget;
BYTE Terminated = FALSE,
TheLine = Config -> StatusLine;
PushWindow(PanelWindow);
AddGList(PanelWindow,GadgetList,(UWORD)-1,(UWORD)-1,NULL);
RefreshGList(GadgetList,PanelWindow,NULL,(UWORD)-1);
GT_RefreshWindow(PanelWindow,NULL);
ActiveGadget = NULL;
while(!Terminated)
{
WaitPort(PanelWindow -> UserPort);
while(!Terminated && (Massage = (struct IntuiMessage *)GT_GetIMsg(PanelWindow -> UserPort)))
{
Class = Massage -> Class;
Code = Massage -> Code;
Gadget = (struct Gadget *)Massage -> IAddress;
GT_ReplyIMsg(Massage);
if(Class == IDCMP_VANILLAKEY)
KeySelect(GadgetArray,GAD_CANCEL,Code,PanelWindow,&Gadget,&Class,&Code);
if(Class == IDCMP_GADGETDOWN)
{
if((Gadget -> GadgetType & GTYP_GTYPEMASK) == GTYP_STRGADGET)
ActiveGadget = Gadget;
}
if(Class == IDCMP_ACTIVEWINDOW && ActiveGadget)
ActivateGadget(ActiveGadget,PanelWindow,NULL);
if(Class == IDCMP_CLOSEWINDOW)
Terminated = TRUE;
GadCheck: if(Class == IDCMP_GADGETUP && !GT_DISABLED(Gadget))
{
switch(Gadget -> GadgetID)
{
case GAD_CR: Config -> SendCR = Code;
break;
case GAD_LF: Config -> SendLF = Code;
break;
case GAD_RECEIVECR: Config -> ReceiveCR = Code;
break;
case GAD_RECEIVELF: Config -> ReceiveLF = Code;
break;
case GAD_BELL: BellMode = Code;
switch(BellMode)
{
case 0: Config -> VisibleBell = FALSE;
Config -> AudibleBell = FALSE;
Config -> SystemBeep = FALSE;
break;
case 1: Config -> VisibleBell = TRUE;
Config -> AudibleBell = FALSE;
Config -> SystemBeep = FALSE;
break;
case 2: Config -> VisibleBell = FALSE;
Config -> AudibleBell = TRUE;
Config -> SystemBeep = FALSE;
break;
case 3: Config -> VisibleBell = TRUE;
Config -> AudibleBell = TRUE;
Config -> SystemBeep = FALSE;
break;
case 4: Config -> VisibleBell = FALSE;
Config -> AudibleBell = FALSE;
Config -> SystemBeep = TRUE;
break;
}
break;
case GAD_SIZE: Config -> EightyColumns = Code;
break;
case GAD_COLOUR: if(Code && !ModeOkay(Config -> DisplayMode))
{
Code = COLOUR_MONO;
GT_SetGadgetAttrs(GadgetArray[GAD_COLOUR],PanelWindow,NULL,
GTCY_Active, Code,
TAG_DONE);
}
Config -> ColourMode = Code;
break;
case GAD_EMULATIONCTRL: Config -> Emulation = Code;
if(Code == EMULATION_ATOMIC && Config -> ColourMode != COLOUR_AMIGA && Config -> ColourMode != COLOUR_MONO)
{
GT_SetGadgetAttrs(GadgetArray[GAD_COLOUR],PanelWindow,NULL,
GTCY_Active,COLOUR_MONO,
TAG_DONE);
Config -> ColourMode = COLOUR_MONO;
}
GT_SetGadgetAttrs(GadgetArray[GAD_EMUNAME],PanelWindow,NULL,
GA_Disabled, Config -> Emulation != EMULATION_EXTERNAL,
TAG_DONE);
GT_SetGadgetAttrs(GadgetArray[GAD_NEWEMU],PanelWindow,NULL,
GA_Disabled, Config -> Emulation != EMULATION_EXTERNAL,
TAG_DONE);
if((Window -> Height >> 3) > 24)
{
GT_SetGadgetAttrs(GadgetArray[GAD_SIZE],PanelWindow,NULL,
GA_Disabled, Config -> Emulation == EMULATION_EXTERNAL,
TAG_DONE);
}
if(IBM)
{
GT_SetGadgetAttrs(GadgetArray[GAD_FONT],PanelWindow,NULL,
GA_Disabled, Config -> Emulation == EMULATION_EXTERNAL,
TAG_DONE);
}
break;
case GAD_FONT: Config -> Font = Code;
break;
case GAD_STATUSLINE: TheLine = Code;
break;
case GAD_USE: Terminated = TRUE;
Config -> CaptureFilter = GT_CHECKED(GadgetArray[GAD_FILTER]);
Config -> DestructiveBackspace = GT_CHECKED(GadgetArray[GAD_DESTRBS]);
Config -> SwapBSDelete = GT_CHECKED(GadgetArray[GAD_SWAP]);
Config -> StripBit8 = GT_CHECKED(GadgetArray[GAD_STRIP]);
Config -> DisableBlinking = GT_CHECKED(GadgetArray[GAD_DISABLE]);
Config -> TitleBar = GT_CHECKED(GadgetArray[GAD_TITLEBAR]);
if(GT_CHECKED(GadgetArray[GAD_FASTER]))
Config -> DisableBlinking |= TERMINAL_FASTER;
strcpy(Config -> EmulationName, GT_STRING(GadgetArray[GAD_EMUNAME]));
strcpy(Config -> KeyMapName, GT_STRING(GadgetArray[GAD_KEYMAP]));
strcpy(Config -> AnswerBack, GT_STRING(GadgetArray[GAD_ANSWERBACK]));
Config -> StatusLine = TheLine;
switch(Config -> ColourMode)
{
case COLOUR_EIGHT: CopyMem(&ANSIColours[0],&Config -> Colours[0],16 * sizeof(UWORD));
break;
case COLOUR_SIXTEEN: CopyMem(&EGAColours[0],&Config -> Colours[0],16 * sizeof(UWORD));
break;
case COLOUR_AMIGA: CopyMem(&DefaultColours[0],&Config -> Colours[0],16 * sizeof(UWORD));
break;
case COLOUR_MONO: CopyMem(&AtomicColours[0],&Config -> Colours[0],16 * sizeof(UWORD));
break;
}
break;
case GAD_NEWEMU: strcpy(DummyBuffer,GT_STRING(GadgetArray[GAD_EMUNAME]));
BlockWindow(PanelWindow);
if(SelectEmulator(DummyBuffer,PanelWindow))
{
GT_SetGadgetAttrs(GadgetArray[GAD_EMUNAME],PanelWindow,NULL,
GTST_String,DummyBuffer,
TAG_DONE);
}
ReleaseWindow(PanelWindow);
break;
case GAD_CANCEL: Terminated = TRUE;
CopyMem(&PrivateConfig,Config,sizeof(struct Configuration));
break;
default: break;
}
}
}
}
RemoveGList(PanelWindow,GadgetList,(UWORD)-1);
PopWindow();
CloseWindow(PanelWindow);
}
}
FreeGadgets(GadgetList);
}